
package com.sy.core.service;


import java.awt.*;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.sy.core.model.SysRelation;
import com.sy.core.mapper.SysRelationMapper;
import org.springframework.transaction.annotation.Transactional;


/**
 * 	TODO 请用一句话描述该类的作用
 * @author CaiXinChong email:1060296473@qq.com
 * @version 1.0
 * @since 1.0
 */

@Service("SysRelationService")
public class SysRelationService  {

	protected final Logger logger = LoggerFactory.getLogger(SysRelationService.class);

   	@Autowired
    private SysRelationMapper  sysRelationMapper;

	/**
	 * All rights Reserved, Designed By Chong.CaiXin
	 * @Description: (查询对象集合)
	 * @author: Chong.CaiXin
	 * @version V1.0
	 *
	 */
	public List<SysRelation> queryByCondition(SysRelation sysRelation){
		return sysRelationMapper.queryByCondition(sysRelation);
	};

	/**
	 * All rights Reserved, Designed By Chong.CaiXin
	 * @Description: (根据主键查询对象)
	 * @author: Chong.CaiXin
	 * @version V1.0
	 *
	 */
	public SysRelation queryByPrimaryKey(String key){
		return sysRelationMapper.queryByPrimaryKey(key);
	};

	/**
	 * All rights Reserved, Designed By Chong.CaiXin
	 * @Description: (新增单个对象)
	 * @author: Chong.CaiXin
	 * @version V1.0
	 *
	 */
	public void insert(SysRelation sysRelation){ sysRelationMapper.insertSelective(sysRelation);};

	@Transactional
	public void insertBatch(List<SysRelation> list){
		list.forEach(sysRelationMapper::insertSelective);
	}
	/**
	 * All rights Reserved, Designed By Chong.CaiXin
	 * @Description: (修改单个对象)
	 * @author: Chong.CaiXin
	 * @version V1.0
	 *
	 */
	public void update(SysRelation sysRelation){ sysRelationMapper.updateSelective(sysRelation);};


	/**
	 * All rights Reserved, Designed By Chong.CaiXin
	 * @Description: (根据主键删除对象)
	 * @author: Chong.CaiXin
	 * @version V1.0
	 *
	 */
	public void delete(String pk){ sysRelationMapper.deleteByPrimaryKey(pk);};

	public List<String> queryMenuPk(String rolePk) {
		return sysRelationMapper.queryMenuPk(rolePk);
	}

}
